From: Keir Fraser Date: Wed, 9 Feb 2011 08:44:38 +0000 (+0000) Subject: cpupool: Strict parameter checking for cpupool operations X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10800 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=657c5ca69673e5100ef6143c1a5294e506ff35c1;p=xen.git cpupool: Strict parameter checking for cpupool operations Some cpupool actions didn't check the cpupool_id exactly. For some actions this doesn't make any sense, so refuse those actions if the specified cpupool doesn't exist. Signed-off-by: Juergen Gross --- diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index b90e5c0371..16a1f43d29 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -485,7 +485,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op) ret = -EBUSY; if ( !cpu_isset(cpu, cpupool_free_cpus) ) goto addcpu_out; - c = cpupool_find_by_id(op->cpupool_id, 0); + c = cpupool_find_by_id(op->cpupool_id, 1); ret = -ENOENT; if ( c == NULL ) goto addcpu_out; @@ -501,7 +501,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op) { unsigned cpu; - c = __cpupool_get_by_id(op->cpupool_id, 0); + c = __cpupool_get_by_id(op->cpupool_id, 1); ret = -ENOENT; if ( c == NULL ) break;